﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.Runtime.Serialization;

namespace FileMonitor.Service.Provider.FileMonitor
{
    public enum FileState
    {
        Error=-2,
        ToBeProcess = -1,
        Processing = 0,
        Processed = 1
    }

    [DataContract]
    public class FileInfo
    {
        private string _fileName;
        private string _cuurentFullPath;
        private string _initialFullPath;

        private FileState _state;
        private int _recordsCounts;
        private DateTime _createdDate;
        private DateTime _moveDate;
        private DateTime _processedDate;


        [DataMember]
        public string FileName
        {
            get {return  this._fileName; }
            set { this._fileName = value; }
        }

        [DataMember]
        public string CuurentFullPath
        {
            get { return this._cuurentFullPath; }
            set { this._cuurentFullPath = value; }
        }

        [DataMember]
        public string InitialFullPath
        {
            get { return this._initialFullPath; }
            set
            {
                this._initialFullPath = value;
               this._createdDate= System.IO.File.GetCreationTime(InitialFullPath);
            }
        }

        [DataMember]
        public FileState State
        {
            get { return this._state; }
            set { this._state = value; }
        }

        [DataMember]
        public int RecordCounts
        {
            get { return this._recordsCounts; }
            set { this._recordsCounts = value; }
        }

        [DataMember]
        public DateTime CreatedDate
        {
            get { return this._createdDate; }
            set { this._createdDate = value; }
        }

        [DataMember]
        public DateTime MoveDate
        {
            get { return this._moveDate; }
            set { this._moveDate = value; }
        }
        
        [DataMember]
        public DateTime ProcessedDate
        {
            get { return this._processedDate; }
            set { this._processedDate = value; }
        }

        public FileInfo(string FileName)
        {
            this._fileName = FileName;
        }
    }
}
